import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.SimpleTimeZone;
import java.util.TimeZone;

public class TestDate
{
	public static void main(String[] args)
	{
		Calendar cal = Calendar.getInstance();
		GregorianCalendar calendar = new GregorianCalendar();
		String[] ids = TimeZone.getAvailableIDs(1 * 60 * 60 * 1000);
		SimpleTimeZone tz = new SimpleTimeZone(1 * 60 * 60 * 1000, ids[0]);
		tz.setStartRule(calendar.MARCH, -1, calendar.SUNDAY, 2 * 60 * 60 * 1000);
		tz.setEndRule(calendar.OCTOBER, -1, calendar.SUNDAY, 3 * 60 * 60 * 1000);
		String Datestring;
		
		System.out.println("YEAR: " + calendar.get(calendar.YEAR) + calendar.YEAR);
 System.out.println("MONTH: " + calendar.get(calendar.MONTH));
 System.out.println("Day:   " + calendar.get(calendar.DAY_OF_MONTH));
  System.out.println("DATE: " + calendar.get(calendar.DATE));
  
  int day = calendar.get(calendar.DAY_OF_MONTH);
  int month = calendar.get(calendar.MONTH);
  int year = calendar.get(calendar.YEAR);
  System.out.printf("final DATE:   " + calendar.get(calendar.DAY_OF_MONTH) + "." + calendar.get(calendar.MONTH) + "." + calendar.get(calendar.YEAR));
  System.out.printf( "%tF%n", cal );                 
	}
}